#!/bin/sh -ux

caches="$HOME/.gradle/caches"

rm -rf \
   "$caches"/*/plugin-resolution

find "$caches" -name buildSrc.jar -delete
find "$caches" -name cache.properties -delete
find "$caches" -name workerMain -type d -prune -exec rm -r "{}" \;
find "$caches" -name '*.bin' -delete
find "$caches" -name '*.lock' -delete

# Consider script to have succeeded even if some "find ... -delete" commands failed.
:
